package com.AIDS.AIDSweeper.server.model;

import com.google.appengine.api.datastore.GeoPt;
import com.google.appengine.api.datastore.Key;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Gamer {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;
	
	@Persistent
	private GeoPt Position;
	
	@Persistent
	private int score;
	
	@Persistent
	private Key gamePlayer;
	
	@Persistent
	private Game myGame;
	
	@Persistent
	private String status;

	@Persistent
	private String role;
	
	@Persistent
	private boolean admin;
	
	public Gamer(GeoPt position, int score, Key gamePlayer,Game myGame, String status, String role, boolean admin) {
		super();
		Position = position;
		this.score = score;
		this.gamePlayer = gamePlayer;
		this.myGame = myGame;
		this.status = status;
		this.role = role;
		this.admin = admin;
	}

	public Key getId() {
		return id;
	}

	public void setId(Key id) {
		this.id = id;
	}

	public GeoPt getPosition() {
		return Position;
	}

	public void setPosition(GeoPt position) {
		Position = position;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public Key getGamePlayer() {
		return gamePlayer;
	}

	public void setGamePlayer(Key gamePlayer) {
		this.gamePlayer = gamePlayer;
	}

	public Game getMyGame() {
		return myGame;
	}

	public void setMyGame(Game myGame) {
		this.myGame = myGame;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	public String getRole() {
		return role;
	}

	public void setRole(String role) {
		this.role = role;
	}

	public boolean isAdmin() {
		return admin;
	}

	public void setAdmin(boolean admin) {
		this.admin = admin;
	}

	@Override
	public String toString() {
		return "<id>"+id+"</id><Position>"+Position+"</Position><score>"+score+"</score><playerId>"+gamePlayer.getId()+"</playerId><gameId>"+myGame.getId()+"</gameId>";
	}
}